package com.mes_for_xxxxxx.config;

import com.mes_for_xxxxxx.interceptor.JwtUserInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author LJK
 * @description
 * @date 2024/9/15
 */
@Configuration
@Slf4j
public class WebMvcConfig extends WebMvcConfigurationSupport {
    @Autowired
    private JwtUserInterceptor jwtUserInterceptor;

    protected void addInterceptors(InterceptorRegistry registry) {
        log.info("登录拦截器注册成功");
        registry.addInterceptor(jwtUserInterceptor)
//                .addPathPatterns("/**")
//                .addPathPatterns("/processflow/add")
                .addPathPatterns("/processflow/receive")
                .excludePathPatterns("/employee/login");
    }
}
